<template>
	<div class="userInfo">
		<div class="userInfoItem">
			<div class="userInfoItem_left">
				姓名
			</div>
			<div class="userInfoItem_right">
				{{userInfo.name || ''}}
			</div>
		</div>
		<div class="userInfoItem">
			<div class="userInfoItem_left">
				性别
			</div>
			<div class="userInfoItem_right">
				{{userInfo.sex || ''}}
			</div>
		</div>
		<div class="userInfoItem">
			<div class="userInfoItem_left">
				联系方式
			</div>
			<div class="userInfoItem_right">
				{{userInfo.phone || ''}}
			</div>
			<div class="userInfoItem_right_span" @click='changePhone()'>
				修改
			</div>
		</div>
		<div class="userInfoItem">
			<div class="userInfoItem_left">
				抖音号(大号)
			</div>
			<div class="userInfoItem_right">
				<!-- {{userInfo.big_doyin || ''}} -->
				<input type="text" v-model="userInfo.big_doyin">
			</div>
		</div>
		<div class="userInfoItem">
			<div class="userInfoItem_left">
				抖音号(小号)
			</div>
			<div class="userInfoItem_right">
				<!-- {{userInfo.small_doyin || ''}} -->
				<input type="text" v-model="userInfo.small_doyin">
			</div>
		</div>
		<div class="userInfoItem">
			<div class="userInfoItem_left">
				抖音号(小号)
			</div>
			<div class="userInfoItem_right">
				<!-- {{userInfo.smalls_doyin || ''}} -->
				<input type="text" v-model="userInfo.smalls_doyin">
			</div>
		</div>
		<div class="userInfoItem">
			<div class="userInfoItem_left">
				抖音号(小号)
			</div>
			<div class="userInfoItem_right">
				<!-- {{userInfo.small_doyin || ''}} -->
				<input type="text" v-model="userInfo.smallss_doyin">
			</div>
		</div>
		<div class="userInfoItem">
			<div class="userInfoItem_left">
				抖音号(小号)
			</div>
			<div class="userInfoItem_right">
				<!-- {{userInfo.small_doyin || ''}} -->
				<input type="text" v-model="userInfo.smallsss_doyin">
			</div>
		</div>
		<div class="userInfoItem">
			<div class="userInfoItem_left">
				抖音号(小号)
			</div>
			<div class="userInfoItem_right">
				<!-- {{userInfo.small_doyin || ''}} -->
				<input type="text" v-model="userInfo.smallssss_doyin">
			</div>
		</div>
		<div class="userInfoItem">
			<div class="userInfoItem_left">
				抖音号(小号)
			</div>
			<div class="userInfoItem_right">
				<!-- {{userInfo.small_doyin || ''}} -->
				<input type="text" v-model="userInfo.smallsssss_doyin">
			</div>
		</div>
		<div class="userInfoItem">
			<div class="userInfoItem_left">
				运营
			</div>
			<div class="userInfoItem_right">
				{{userInfo.operate || ''}}
			</div>
		</div>
		<div class="userInfoItem">
			<div class="userInfoItem_left">
				直播花名
			</div>
			<div class="userInfoItem_right">
				<!-- {{userInfo.nickname || ''}} -->
				<input type="text" v-model="userInfo.nickname">
			</div>
		</div>
		<div class="userInfoItem">
			<div class="userInfoItem_left">
				是否养宠
			</div>
			<div class="userInfoItem_right">
				{{userInfo.pet || ''}}
			</div>
		</div>
		<div class="inviteIndexItems_btn" @click='inviteSureEvent()'>
			提交
		</div>
	</div>
</template>

<script>
	export default {
		data() {
			return {
				userInfo: {},
				anchor_id: uni.getStorageSync('author_id'),
			}
		},
		onLoad() {
			this.getUserInfo()
		},
		methods: {
			async getUserInfo() {
				const {
					data
				} = await this.$request(this.$Api.anchorDetai, {
					anchor_id: this.anchor_id
				}, "POST")
				if (data.code !== 0) return
				this.userInfo = data.data.list
			},
			changePhone() {
				uni.navigateTo({
					url: '/pages/my/changePhone'
				})
			},
			async inviteSureEvent(){
				const params ={
					anchor_id: this.anchor_id,
					...this.userInfo
				}
				const {
					data
				} = await this.$request(this.$Api.indexSaves,params, "POST")
				if (data.code !== 0) return
				uni.showToast({
					title: "修改成功",
					mask: true,
					icon: "none",
					duration: 1000
				})
				this.getUserInfo()
			}
		}
	}
</script>

<style lang="less">
	.userInfo {
		padding: 28rpx 0;
		box-sizing: border-box;

		.userInfoItem {
			display: flex;
			align-items: center;
			padding: 0 46rpx;
			font-size: 28rpx;
			width: 100%;
			height: 100rpx;
			box-sizing: border-box;
			background: #fff;
			border-bottom: 1px solid #C9C9C9;
			position: relative;

			.userInfoItem_right_span {
				position: absolute;
				font-size: 28rpx;
				color: #9013FE;
				right: 46rpx;
				top: 30rpx;
			}


			.userInfoItem_left {
				width: 170rpx;
				margin-right: 60rpx;
			}
		}

		.userInfoItem:last-child {
			border: none !important;
		}
		.inviteIndexItems_btn {
			width: 750rpx;
			height: 100rpx;
			background: #9013FE;
			line-height: 100rpx;
			font-size: 28rpx;
			text-align: center;
			color: #fff;
			position: fixed;
			bottom: 0;
			left: 0;
		}
	}
</style>